package cn.lysj.framework.common.service;

import cn.lysj.framework.base.BaseService;
import cn.lysj.framework.common.domain.Log;
import cn.lysj.framework.common.repository.LogRepository;
import cn.lysj.framework.common.utils.web.Resp;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import javax.annotation.Resource;

/**
 * @author zk
 * @description 日志服务层
 * @create 2018-08-13 15:32:38
 **/
@Slf4j
@Service
@Transactional
public class LogService implements BaseService<Log> {

    @Resource
    private LogRepository logRepository;

    @Override
    public LogRepository getRepository() {
        return logRepository;
    }

    /**
     * @author ww
     * @date 2018-08-16 11:39
     * @Description 删除所有日志
     */
    public boolean deleteAll(){
        try {
            logRepository.deleteAll();
        }catch (Exception e){
            return false;
        }
        return true;
    }
}